﻿@page "/mind-map"
@inject IStringLocalizer<MindMaps> Localizer

<h3>@Localizer["MindMapTitle"]</h3>

<h4>@Localizer["MindMapDescription"]</h4>

<PackageTips Name="BootstrapBlazor.MindMap" />

<DemoBlock Title="@Localizer["MindMapNormalTitle"]" Introduction="@Localizer["MindMapDescription"]" Name="MindMapNormal">
    <MindMap @ref="_mindMap" Options="_options" Data="@Data" OnReceive="@OnReceive" OnError="@OnError" StyleCss="height: 55vh;" />
    <div class="row g-3 mt-3">
        <div class="col-12">
            <Button Text="@Localizer["Sample1ButtonText"]" OnClick="Sample" />
            <Button Text="@Localizer["Sample2ButtonText"]" OnClick="Sample2" />
            <Button Text="@Localizer["ExportButtonText"]" OnClick="Export" />
            <Button Text="@Localizer["ExportJsonButtonText"]" OnClick="ExportJson" />
            <Button Text="@Localizer["GetFullDataButtonText"]" OnClick="GetFullData" />
            <Button Text="@Localizer["GetDataButtonText"]" OnClick="GetData" />
            <Button Text="@Localizer["SetDataButtonText"]" OnClick="SetData" />
            <Button Text="@Localizer["ResetButtonText"]" OnClick="Reset" />
        </div>
        <div class="col-12 col-sm-3 mt-3">
            <Select @bind-Value="_options.Layout" ShowLabel="true" />
        </div>
        <div class="col-12 col-sm-3 mt-3">
            <Select @bind-Value="_options.Theme" ShowLabel="true" />
        </div>
        <div class="col-12">
            <Textarea @bind-Value="_result" rows="10" />
        </div>
    </div> 
</DemoBlock>

<AttributeTable Items="@GetAttributes()" />

<AttributeTable Title="@Localizer["OptionsText"]" Items="@GetOptionsAttributes()" />

<AttributeTable Title="@Localizer["NodeDataText"]" Items="@GetNodeDataAttributes()" />
